package com.firstsource.networking.ip.tracker.util;

import org.zkoss.zk.ui.Desktop;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zul.Vbox;

public class Terminal extends Vbox {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private DeviceConsole console ;

	private DeviceSession session ;

	private Desktop desktop ;

	public void init() {
		desktop = Executions.getCurrent().getDesktop();
		
		console = (DeviceConsole) desktop.getWebApp().getAttribute("console") ;
		if (console==null) {
			console = new DeviceConsole("207.52.190.5") ;
			desktop.getWebApp().setAttribute("console", console) ;
		}
		desktop.enableServerPush(true);
		session = new DeviceSession(console, "rtCorp06", this.getFellowIfAny("terminalArea")) ;
		session.start() ;
	}

	public void onCreate() {
		init();
	}
}
